package com.zhou.common.operator.log.core.constant;

public enum OperateActionEnum {
    /**
     *
     */
    NON("non", "未知"),
    ADD("add", "添加"),
    MODIFY("modify", "修改"),
    AUDIT("audit", "审核"),
    DELETE("delete", "删除"),
    QUERY("query", "查询"),
    EXPORT("export", "导出"),
    LOGIN("login", "登录"),
    LOGOUT("logout", "退出"),
    OPERATION("operation", "操作"),
    BATCH_OPERATION("batch_operation", "批量操作");

    public String action;
    public String desc;

    public static OperateActionEnum getByAction(String action) {
        OperateActionEnum[] values = values();
        for (int i = 0; i < values.length; ++i) {
            OperateActionEnum actionEnum = values[i];
            if (actionEnum.action.equals(action)) {
                return actionEnum;
            }
        }
        return NON;
    }

    public String getAction() {
        return this.action;
    }

    public String getDesc() {
        return this.desc;
    }

    OperateActionEnum(final String action, final String desc) {
        this.action = action;
        this.desc = desc;
    }
}

